<html>
	<head>
		<script runat="server" src="../../src/Norm.js"></script>
		<script runat="server" src="../../src/Norm.Logger.Jaxer.js"></script>
		<script runat="server" src="../../src/Norm.Database.Jaxer.js"></script>
		<script runat="server" src="../../src/Norm.ResultIterator.Jaxer.js"></script>
		<script runat="server" src="../../src/Norm.LastIdManager.js"></script>
		<script runat="server" src="../../src/Norm.Events.js"></script>
		<script runat="server" src="../../src/Norm.Sql.js"></script>
		<script runat="server" src="../../src/Norm.Fields.js"></script>
		<script runat="server" src="../../src/Norm.Model.js"></script>
		<script runat="server" src="../../src/Norm.Introspection.js"></script>
		<script runat="server" src="../../src/Norm.Transaction.js"></script>
		<script runat="server">
			Norm.Database.name = "test.introspection";
			var Model1 = new Norm.Model({
				name : "Model1",
				fields : {
					name : new Norm.Fields.String({maxLength : 25})
				}
			});
			
			var Model2 = new Norm.Model({
				name : "Model2",
				fields : {
					name : new Norm.Fields.String({maxLength : 25})
				}
			});
			
			var Tests = {
				
				up : function() {
					
					Norm.LastIdManager.resetTable("Model1");			// this test may expect reset row ids after dropping the table
					Norm.LastIdManager.resetTable("Model2");			// this test may expect reset row ids after dropping the table
					Model1.dropTable();
					Model2.dropTable();
				},
				
				"test if doesTableExist work" : function() {
					
					UnitTest.assertFalse(Norm.Introspection.doesTableExist("Model1", "Model2"));
					Model1.createTable();
					UnitTest.assertTrue(Norm.Introspection.doesTableExist("Model1"));
					Model2.createTable();
					UnitTest.assertTrue(Norm.Introspection.doesTableExist("Model2"));
					UnitTest.assertTrue(Norm.Introspection.doesTableExist("Model1", "Model2"));
				},
				
				down : function() {
					
					Model1.dropTable();
					Model2.dropTable();
				}
			};
		</script>
		<script runat="server" src="unit-test.js"></script>
	</head>
	<body>
		
	</body>
</html>
